using System;
using Admin.NET.Core;
using SqlSugar;

namespace Admin.NET.Application;

[SugarTable("ElectricMeter", "电表")]
[SysTable]
public class ElectricMeter : EntityBaseData
{
	/// <summary>
	/// 表号/imei/序列号
	/// </summary>
	public string Sn { get; set; }

	/// <summary>
	/// 名称
	/// </summary>
	public string Name { get; set; }

	/// <summary>
	/// 协议类型：0：4G 1采集网关
	/// </summary>
	public int ProtocolType { get; set; }

	/// <summary>
	/// 信号状态：0离线，1在线
	/// </summary>
	public int SignalStatus { get; set; }

	/// <summary>
	/// 电闸状态/通电状态，0断电，1通电
	/// </summary>
	public int GateStatus { get; set; }

	/// <summary>
	/// 表地址或站号，（645 高位-&gt;低位，需在保存或编辑时颠倒一次,作为指令下发等使用）
	/// </summary>
	public string Addr { get; set; }

	/// <summary>
	/// 645表地址,低位-&gt;高位，平台显示所用
	/// </summary>
	public string? LowAddr { get; set; }

	/// <summary>
	/// 倍率，pt*ct，默认1
	/// </summary>
	public double Multiplier { get; set; }

	/// <summary>
	/// 组合有功总电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? CombinedActiveTotalElectricEnergy { get; set; }

	/// <summary>
	/// 组合有功尖电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? CombinedActiveSharpElectricEnergy { get; set; }

	/// <summary>
	/// 组合有功峰电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? CombinedActivePeakElectricEnergy { get; set; }

	/// <summary>
	/// 组合有功平电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? CombinedActiveFlatElectricEnergy { get; set; }

	/// <summary>
	/// 组合有功谷电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? CombinedActiveValleyElectricEnergy { get; set; }

	/// <summary>
	/// 组合有功深谷电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? CombinedActiveDeepValleyElectricEnergy { get; set; }

	/// <summary>
	/// 电价方案
	/// </summary>
	public long? PriceRuleId { get; set; }

	/// <summary>
	/// 区域id
	/// </summary>
	public long? BuildingId { get; set; }

	/// <summary>
	/// 房间id
	/// </summary>
	public long? RoomId { get; set; }

	/// <summary>
	/// 采集器id
	/// </summary>
	public long? CollectorId { get; set; }

	/// <summary>
	/// 最新抄表时间
	/// </summary>
	public DateTime? LatestMeterReadingTime { get; set; }

	/// <summary>
	/// 最新在线时间或离线时间
	/// </summary>
	public DateTime? LastOnlineTime { get; set; }

	/// <summary>
	/// 下发状态，0未下发，1下发中，2下发成功，3下发失败
	/// </summary>
	public int IssuedStatus { get; set; }

	/// <summary>
	/// 经度
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? Longitude { get; set; }

	/// <summary>
	/// 纬度
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? Latitude { get; set; }

	/// <summary>
	/// 标签id
	/// </summary>
	public long? LabelId { get; set; }

	/// <summary>
	/// false不是 true是
	/// </summary>
	public bool IsPublicMeter { get; set; }

	/// <summary>
	/// 是否开启保电模式
	/// </summary>
	[SugarColumn(DefaultValue = "false")]
	public bool IsElectricityProtection { get; set; }

	/// <summary>
	/// 保电开始日期
	/// </summary>
	public DateTime? ElectricityProtectionBegin { get; set; }

	/// <summary>
	/// 保电结束日期
	/// </summary>
	public DateTime? ElectricityProtectionEnd { get; set; }

	/// <summary>
	/// 是否允许业主控制电表：true允许，false禁止
	/// </summary>
	[SugarColumn(DefaultValue = "true")]
	public bool OwnerControl { get; set; }

	/// <summary>
	/// 是否补贴
	/// </summary>
	[SugarColumn(DefaultValue = "0")]
	public int IsSubsidy { get; set; }

	/// <summary>
	/// 补贴费用（当月补贴的额度，建议设置补贴可以在当月或者前一个月进行，不可跨月，比如现在已经有补贴，现在调整三个月后的补贴额度，那么接下来的两个月会无补贴，出现空档期）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal SubsidyFee { get; set; }

	/// <summary>
	/// 当月补贴的费用（当月已补贴的费用）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal NowSubsidyFee { get; set; }

	/// <summary>·
	/// 预约补贴费用（计划补贴的费用）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal ReservationSubsidyFee { get; set; }

	/// <summary>
	/// 补贴时间（当前补贴的月份）
	/// </summary>
	public DateTime? SubsidyTime { get; set; }

	/// <summary>
	/// 预约补贴时间（计划从哪个月份开始补贴）
	/// </summary>
	public DateTime? ReservationSubsidyTime { get; set; }

	/// <summary>
	/// 信号强度
	/// </summary>
	public int? RSSI { get; set; }

	/// <summary>
	/// 起始组合有功总电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? BaseCombinedActiveTotalElectricEnergy { get; set; }

	/// <summary>
	/// 起始组合有功尖电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? BaseCombinedActiveSharpElectricEnergy { get; set; }

	/// <summary>
	/// 起始组合有功峰电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? BaseCombinedActivePeakElectricEnergy { get; set; }

	/// <summary>
	/// 起始组合有功平电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? BaseCombinedActiveFlatElectricEnergy { get; set; }

	/// <summary>
	/// 起始组合有功谷电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? BaseCombinedActiveValleyElectricEnergy { get; set; }

	/// <summary>
	/// 起始组合有功深谷电能（表显）
	/// </summary>
	[SugarColumn(Length = 28, DecimalDigits = 10)]
	public decimal? BaseCombinedActiveValleyDeepElectricEnergy { get; set; }

	/// <summary>
	/// 电损百分比，用电量的百分比*电价==结算金额
	/// </summary>
	public double? ElectricityLossPercentage { get; set; }

	/// <summary>
	/// 是否已经抄表，true，超过表，false未抄表，未抄表的则可以更改底数
	/// </summary>
	[SugarColumn(DefaultValue = "false")]
	public bool IsRead { get; set; }

	/// <summary>
	/// 品牌型号id
	/// </summary>
	[SugarColumn(DefaultValue = "0")]
	public long BrandId { get; set; }

	/// <summary>
	/// 父级id
	/// </summary>
	[SugarColumn(DefaultValue = "0")]
	public long Pid { get; set; }
}
